package com.winkey.facility.gateway.service.parking.impl;

import com.sun.jna.NativeLong;
import com.winkey.facility.gateway.service.parking.ParkingFacilityService;
import com.winkey.facility.gateway.service.parking.impl.aist.Camera;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.swing.*;
import java.io.UnsupportedEncodingException;

/**
 * @author Administrator
 */
@Service
public class BaiShengParkingFacilityImpl implements ParkingFacilityService {

    @Autowired
    private Camera camera;

    @Override
    public int restart(NativeLong loginid) {
        return camera.restart(loginid);
    }

    @Override
    public void playVideo(NativeLong logid, JFrame Video) {
        camera.playVideo(logid,Video);
    }

    @Override
    public int SnapPic(String CamIp) {

        return camera.SnapPic(CamIp);
    }

    @Override
    public int openGate(String CamIp) {
        return camera.openGate(CamIp);
    }

    @Override
    public int closeGate(String CamIp) {
        return camera.closeGate(CamIp);
    }

    @Override
    public int setWorkMode(NativeLong loginid, byte mode) {
        return camera.setWorkMode(loginid,mode);
    }

    @Override
    public int setParkVip(NativeLong loginid, byte[] plate, int type, int[] startTime, int[] endTime) throws UnsupportedEncodingException {
        return camera.setParkVip(loginid,plate,type,startTime,endTime);
    }
}
